<%-- 
    Document   : index
    Created on : 22.11.2014, 13:56:17
    Author     : Martin Klvaňa, 395893
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="<c:url value="/resources/css/main.css" />">
        <title><fmt:message key="revision.index.title" /></title>
    </head>
    <body>
        <h1><fmt:message key="revision.index.title" /></h1>

        <c:if test="${empty revisions}">
            <fmt:message key="revision.index.norevisions" />
        </c:if>
        <c:if test="${not empty revisions}">

            <table class="table table-striped">
                <th>
                </th>
                <th>
                    <fmt:message key="revision.description" />
                </th>
                <th>
                    <fmt:message key="revision.dateOfRevision" />
                </th>
                <th>
                    <fmt:message key="revision.machine" />
                </th>
                <th>
                </th>
                <c:forEach var="r" items="${revisions}">
                    <tr>
                        <td>
                            <a href="<c:url value="/revision/detail/${r.id}"/>"><fmt:message key="detail" /></a>
                        </td>
                        <td>
                            <c:out value="${r.description}"/>
                        </td>
                        <td>
                            <c:out value="${r.dateOfRevision}"/>
                        </td>
                        <td>
                            <c:out value="${r.machine}"/>
                        </td>
                        <td>
                            <a href="<c:url value="/revision/edit/${r.id}"/>">
                                <img src="<c:url value="/resources/pictures/edit.png" />" title="<fmt:message key="edit" />" /> <fmt:message key="edit" />
                            </a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </c:if>
    </body>
</html>
